<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h2></h2>

    <!-- <p>
      <input class="input" type="text" v-model="userName" />
    </p>
    <p>
      <input class="input" type="password" v-model="passWord" />
    </p> -->
    <p>
      <button class="btn">测试</button>
    </p>
  </div>
</template>

<script>
export default {
  name: "Login",
  data() {
    return {
      msg: "欢迎登录",
      userName: "",
      passWord: "",
    };
  },
  created() {},
  methods: {
    Login() {
      var that=this;
      if(that.data.userName==""){return;}
            if(that.data.passWord==""){return;}
      that.$axios({
        method: "post",
        url: "api",
        data: this.qs.stringify({
          //这里是发送给后台的数据
          userId: this.userId,
          token: this.token,
        }),
      })
        .then((response) => {
          //这里使用了ES6的语法
          console.log(response); //请求成功返回的数据
        })
        .catch(
          (error) => console.log(error) //请求失败返回的数据
        );
    },
  },
};
</script>
<style scoped>
h1,
h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
.input {
  border: 1px solid #d1d1d1;
  height: 30px;
  width: 20%;
}
.btn {
  display: block;
  border: none;
  background: orange;
  color: white;
  width: 20%;
  height: 50px;
  cursor: pointer;
  margin: auto;
  font-size: 20px;
}
.input:focus,
.btn:focus {
  border: 1px solid #d1d1d1;
}
</style>
